<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>列表</title>
    <style>
    .card {
        background-color:rgba(112,128,144,0.5);
        padding: 20px;
        margin-top: 20px;
        border-radius: 50px;
        color:white;
    }
</style>
</head>
<body>
<a href="/editArticle">添加文章列表内容</a>
{% for c in page_obj %}
<div class="card">
    <h2 style="text-align: center;">{{c.title}}</h2>
    <h5 style="text-align: center;">{{c.time}}</h5>
    <hr style="border:white solid 1px;" />
    <p style="text-indent:2em">{{c.desc}}</p>
</div>
{% endfor %}
<!-- 分页控件 -->
<div style="text-align:right;margin:20px 0;">
    <span>
        {% if page_obj.has_previous %}
        <a href="?page=1">&laquo;第1页</a>
        <a href="?page={{page_obj.previous_page_num}}">&lsaquo;上一页</a>
        {% endif %}
        {% if page_obj.has_next %}
        <a href="?page={{page_obj.next_page_number}}">下一页 &laquo;</a>
        <a href="?page={{page_obj.paginator.num_pages}}">最后1页 &rsaquo;</a>
        {% endif %}
    </span>
</div>
</body>
</html>